from django.shortcuts import render
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from .serial import GetHomeSecondCategorySerializer
from .models import HomeSecondCategoryModel
# Create your views here.


class GetCategory(APIView):

    def get(self, request):
        data = HomeSecondCategoryModel.objects.all()
        res = GetHomeSecondCategorySerializer(data, many=True)
        return Response({"msg":res.data, "code": 200}, status=status.HTTP_200_OK)
